<!doctype html>
<html lang="zh-Hans">
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <title>易再生-中国再生资源交易平台</title>
    <link rel="stylesheet" href="$!webPath/resources/font-awesome/css/font-awesome.min.css" />
    <link rel="stylesheet" href="$!webPath/resources/style/shop/default/css/yzs.css?v=1" />
    <script src="$!webPath/resources/js/jquery-1.8.3.min.js"></script>
    <script src="$!webPath/resources/layui/layui.all.js"></script>
    <script type="text/javascript">
    	 var falg = true;
    	 var msgCode="";
    	 var cartAddLeng = $!addresses.size();
         function address(){
	       	if(cartAddLeng>8){
	       		 layer.msg("联系地址最多新增8个！",{icon:7});
	       		 return;
	       	}
        	falg = true;
       	    layer.open({
       	        type: 2,
       	        title: '新增收货地址',
       	        shadeClose: false,
       	        shade: 0.8,
       	        area: ['560px', '420px'],
       	        content: '$!webPath/cart_address.htm',
       	     	end:function(){
       	        	if(falg){
       	        		if(msgCode=="noSession"){
       	        			window.location.href="$!webPath/index.htm";
       	        		}else if(msgCode=="success"){
       	        			window.location.reload()
       	        		}
       	        	}
       	        },cancel:function(index,layero){
       	        	falg = false;
       	        }
       	    });
         }
         jQuery(function(){
	        jQuery(".yzs-order-address .more").click(function(){
	        	 if(jQuery(this).siblings().hasClass("hide")){
	        		 jQuery(this).siblings(".hide").addClass("show").removeClass("hide");
	        		 jQuery(this).html("收起&nbsp;<i class='fa fa-angle-double-up'></i>");
	        	 }else{
	        		 jQuery(this).siblings(".show").addClass("hide").removeClass("show");
	        		 jQuery(this).html("更多地址&nbsp;<i class='fa fa-angle-double-down'></i>");
	        	 }
	        })
         })
        function defaltFun(addr_id){
            var index;
       	   jQuery.ajax({type:'POST',url:'$!webPath/cut_address.htm',data:{'id':addr_id},dataType:'json',
				  beforeSend:function(){
					  index = layer.load(1, {shade: [0.1,'#fff']});
				  },success:function(data){
					  layer.close(index);
					  var icon = data.code=="success"?1:2;
					  layer.msg(data.msg,{icon:icon});
					  if(data.code=="success"){
						  window.location.reload();
					  }
			  },error:function(){
				 window.location.reload();
			  }
 	  	  });
        }
        
       function updateAddress(id){
    	   falg = true;
    	   layer.open({
      	        type: 2,
      	        title: '修改收货地址',
      	        shadeClose: false,
      	        shade: 0.8,
      	        area: ['560px', '420px'],
      	        content: '$!webPath/cart_address.htm?id='+id,
      	     	end:function(){
      	        	if(falg){
      	        		if(msgCode=="noSession"){
      	        			window.location.href="$!webPath/index.htm";
      	        		}else if(msgCode=="success"){
      	        			window.location.reload()
      	        		}
      	        	}
      	        },cancel:function(index,layero){
      	        	falg = false;
      	        }
      	    });
       }
       function delAddress(id){
    	   layer.confirm('是否删除改条数据？', {
    		   btn: ['确定','取消'] //按钮
    		 }, function(){
    		     jQuery.ajax({type:'POST',url:'$!webPath/del_address.htm',data:{'id':id},dataType:'json',
    					success:function(data){
    						  var icon = data.code=="success"?1:2;
    						  layer.msg(data.msg,{icon:icon});
    						  if(data.code=="success"){
    	      	        			window.location.reload()
    	      	        	}
    				  },error:function(){
    					 window.location.reload();
    				  }
    	 	  	  });
    			 
    		 }, function(){
    		   
    	  });
       }
    </script>
</head>
<body>
	$!httpInclude.include("/top.htm")
    $!httpInclude.include("/head.htm")
    $!httpInclude.include("/nav.htm")
	<div class="yzs-location-panner" style="background:#fff;margin-top:135px;">
		<div class="yzs-location">首页 &gt;  提交订单</div>
	</div>
	<div class="yzs-container-pannel">
		<div class="yzs-container">
			<div class="yzs-order-title">确认订单信息</div>
			<div class="yzs-order-content">
				<div class="yzs-order-title-sub">收货信息<span style="cursor: pointer" onclick="address();">新增收货地址</span></div>
				<div class="yzs-order-address">
				    #foreach($addx in $!addresses)
						<div class="yzs-order-address-item #if($!velocityCount>1)hide#end"  >
							<div class="#if($!velocityCount==1)yzs-order-address-sel#end">$!addx.trueName</div>
							<div>#if($!addx.area) $!addx.area.parent.parent.areaName &nbsp;&nbsp; $!addx.area.parent.areaName &nbsp;&nbsp;$!addx.area.areaName &nbsp;&nbsp;$!addx.area_info &nbsp;&nbsp;$!addx.trueName&nbsp;&nbsp;$!addx.telephone #end<span style="margin-left: 10px;cursor: pointer;" onclick="defaltFun($!addx.id)">默认地址</span></div>
							<div><span style="cursor: pointer;" onclick="updateAddress($!addx.id);">编辑</span>  <span style="cursor: pointer;" onclick="delAddress($!addx.id);">删除</span></div>
						</div>
					#end
					<div class="blank20 more" style="cursor: pointer;" >更多地址<i class="fa fa-angle-double-down"></i></div>
				</div>
				<div class="yzs-order-title-sub">货品清单<span>返回修改采购单</span></div>
				<div class="yzs-order-list">
					<ul>
					   #foreach($sc in $!cart)
					      #set($total_price = $!sc.total_price)
					      #foreach($obj in $sc.gcs)
					             #if($!obj.goods.goods_main_photo)               
				                	#set($img="$!imageWebServer/$!{obj.goods.goods_main_photo.path}/$!{obj.goods.goods_main_photo.name}_small.$!{obj.goods.goods_main_photo.ext}")
				                 #else
				                 	#set($img="$!imageWebServer/$!{config.goodsImage.path}/$!{config.goodsImage.name}")
				                 #end
						       <li>
									<div class="yzs-order-list-img"><img src="$!img"></div>
									<div class="yzs-order-list-info">
										<div>$!CommUtil.substring("$!obj.goods.goods_name",42)</div>
										<div>库存量：<span style="color:#ff6700;">$!obj.goods.goods_inventory</span>吨</div>
										<div>库存地：#set($ars=$!areaViewTools.getDepotStr($!obj.goods.goods_address)) $!ars</div>
									</div>
									<div class="yzs-order-list-price">¥$!obj.goods.goods_price</div>
									<div class="yzs-order-list-num">x$!obj.count</div>
									<div class="yzs-order-list-status">#if($!obj.count<$!obj.goods.goods_inventory)有货#else 缺货 #end</div>
							   </li>
					      #end
					   #end
					</ul>
				</div>
				<div class="yzs-order-remark">订单备注<input type="text" placeholder="限50个字（请将购买需求在备注中做详细说明）"/></div>
				<div class="yzs-order-title-sub">发票信息<span>修改</span></div>
				<div class="yzs-order-ticket">
					<table cellspacing="0">
						<tr>
							<td>公司名称</td>
							<td>税号</td>
							<td>单位地址</td>
							<td>电话号码</td>
							<td>开户银行</td>
							<td>银行账户</td>
						</tr>
						<tr >
							<td>河北xxx公司</td>
							<td>xxxxxxxxxxxxxxxxxxxxx</td>
							<td>北京通州区马驹桥金桥产业基地环宇路3号桑德集团</td>
							<td>xxxxxxxxxxx</td>
							<td>xxxxxxxxxxxxxxxxxxxxx</td>
							<td>xxxxxxxxxxxxxxxxxxxxx</td>
						</tr>
					</table>
				</div>
				<div class="yzs-order-title-sub">物流费用</div>
				<div class="yzs-order-wlfee">
					<table cellspacing="0">
						<tr>
							<td>库存地</td>
							<td>收货地</td>
							<td>物流费用（元）</td>
						</tr>
						<tr>
							<td>河北-保定-蠡县-1号库</td>
							<td>北京通州区马驹桥金桥产业基地环宇路3号桑德集团</td>
							<td style="color:#ff6700;">500</td>
						</tr>
						<tr>
							<td>河北-保定-蠡县-1号库</td>
							<td>北京通州区马驹桥金桥产业基地环宇路3号桑德集团</td>
							<td style="color:#ff6700;">300</td>
						</tr>
					</table>
				</div>
				<div class="yzs-order-price">
					2件商品，商品总金额 <span>¥$!total_price</span><br>
					运费 <span>¥800.00</span>
				</div>
				<div class="yzs-order-res">
					应付总额 <span>¥283600.00</span><br>
					运送至：北京通州区马驹桥金桥产业基地环宇路3号桑德集团 &nbsp; &nbsp;  收货人：韩梅梅 &nbsp; &nbsp;  18611892672
				</div>
				<div class="yzs-order-btn">
					<div>提交订单</div>
				</div>
			</div>
			
		</div>
		<div class="blank40"></div>		
	</div>
  $!httpInclude.include("/footer.htm") 
</body>
</html>